import request from "@/utils/request";

// 查询券码列表列表
export function listCouponCode(query) {
  return request({
    url: "/cancel/couponCode/list",
    method: "get",
    params: query,
  });
}
//查看虚拟券码列表
export function listVir(query) {
  return request({
    url: "/cancel/coupon/listVir",
    method: "get",
    params: query,
  });
}

// 查询券码列表详细
export function getCouponCode(id) {
  return request({
    url: "/cancel/couponCode/" + id,
    method: "get",
  });
}

// 新增券码列表
export function addCouponCode(data) {
  return request({
    url: "/cancel/couponCode",
    method: "post",
    data: data,
  });
}

// 修改券码列表
export function updateCouponCode(data) {
  return request({
    url: "/cancel/couponCode",
    method: "put",
    data: data,
  });
}

// 删除券码列表
export function delCouponCode(id) {
  return request({
    url: "/cancel/couponCode/" + id,
    method: "delete",
  });
}
//查看所有券码列表
export function mallCodeList(query) {
  return request({
    url: "/cancel/couponCode/mallCodeList",
    method: "get",
    params: query,
  });
}
//作废券码
export function delCode(data) {
  return request({
    url: "/cancel/couponCode/delCode",
    method: "post",
    data,
  });
}
//单个券码激活
export function updateStatus(data) {
  return request({
    url: "/cancel/couponCode/updateStatus",
    method: "put",
    data,
  });
}
//单个修改过期时间
export function updateStatusOutTime(data) {
  return request({
    url: "/cancel/couponCode/updateStatusOutTime",
    method: "put",
    data,
  });
}
